package com.mapflow.geo.logging.model.entities;

// Generated 14-Dec-2011 16:58:39 by Hibernate Tools 3.2.1.GA

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.xml.bind.annotation.XmlRootElement;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableId;

import com.mapflow.model.BaseObject;

/**
 * MfServiceLogId generated by hbm2java
 */
@Entity
@Table(name = "MF_SERVICE_LOG", uniqueConstraints = @UniqueConstraint(columnNames = "ID"))
@Searchable
@XmlRootElement
public class MfServiceLog extends BaseObject implements java.io.Serializable {

  private static final long serialVersionUID = -1354408095266478208L;

  public static final String USER_FIELD_SEPARATOR = ":";

  private Long id;
  private String transactionId;
  private String serviceHost;
  private String serviceName;
  private String clientIp;
  private String clientHostname;
  private Date requestDate;
  private BigDecimal duration;
  private String userField0;
  private String userField1;
  private String userField2;
  private String userField3;
  private String userField4;
  private String userField5;
  private String userField6;
  private String userField7;
  private String userField8;
  private String userField9;

  private String ticket;

  public MfServiceLog() {
  }

  public MfServiceLog(final String transactionId, final String serviceHost,
    final String serviceName, final String clientIp, final String clientHostname,
    final Date requestDate, final BigDecimal duration, final String userField0,
    final String userField1, final String userField2, final String userField3,
    final String userField4, final String userField5, final String userField6,
    final String userField7, final String userField8, final String userField9, final String ticket) {
    this.transactionId = transactionId;
    this.serviceHost = serviceHost;
    this.serviceName = serviceName;
    this.clientIp = clientIp;
    this.clientHostname = clientHostname;
    this.requestDate = requestDate;
    this.duration = duration;
    this.userField0 = userField0;
    this.userField1 = userField1;
    this.userField2 = userField2;
    this.userField3 = userField3;
    this.userField4 = userField4;
    this.userField5 = userField5;
    this.userField6 = userField6;
    this.userField7 = userField7;
    this.userField8 = userField8;
    this.userField9 = userField9;
    this.ticket = ticket;
  }

  @Override
  public boolean equals(final Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final MfServiceLog other = (MfServiceLog) obj;
    if (clientHostname == null) {
      if (other.clientHostname != null) {
        return false;
      }
    }
    else if (!clientHostname.equals(other.clientHostname)) {
      return false;
    }
    if (clientIp == null) {
      if (other.clientIp != null) {
        return false;
      }
    }
    else if (!clientIp.equals(other.clientIp)) {
      return false;
    }
    if (duration == null) {
      if (other.duration != null) {
        return false;
      }
    }
    else if (!duration.equals(other.duration)) {
      return false;
    }
    if (id == null) {
      if (other.id != null) {
        return false;
      }
    }
    else if (!id.equals(other.id)) {
      return false;
    }
    if (requestDate == null) {
      if (other.requestDate != null) {
        return false;
      }
    }
    else if (!requestDate.equals(other.requestDate)) {
      return false;
    }
    if (serviceHost == null) {
      if (other.serviceHost != null) {
        return false;
      }
    }
    else if (!serviceHost.equals(other.serviceHost)) {
      return false;
    }
    if (serviceName == null) {
      if (other.serviceName != null) {
        return false;
      }
    }
    else if (!serviceName.equals(other.serviceName)) {
      return false;
    }
    if (ticket == null) {
      if (other.ticket != null) {
        return false;
      }
    }
    else if (!ticket.equals(other.ticket)) {
      return false;
    }
    if (transactionId == null) {
      if (other.transactionId != null) {
        return false;
      }
    }
    else if (!transactionId.equals(other.transactionId)) {
      return false;
    }
    if (userField0 == null) {
      if (other.userField0 != null) {
        return false;
      }
    }
    else if (!userField0.equals(other.userField0)) {
      return false;
    }
    if (userField1 == null) {
      if (other.userField1 != null) {
        return false;
      }
    }
    else if (!userField1.equals(other.userField1)) {
      return false;
    }
    if (userField2 == null) {
      if (other.userField2 != null) {
        return false;
      }
    }
    else if (!userField2.equals(other.userField2)) {
      return false;
    }
    if (userField3 == null) {
      if (other.userField3 != null) {
        return false;
      }
    }
    else if (!userField3.equals(other.userField3)) {
      return false;
    }
    if (userField4 == null) {
      if (other.userField4 != null) {
        return false;
      }
    }
    else if (!userField4.equals(other.userField4)) {
      return false;
    }
    if (userField5 == null) {
      if (other.userField5 != null) {
        return false;
      }
    }
    else if (!userField5.equals(other.userField5)) {
      return false;
    }
    if (userField6 == null) {
      if (other.userField6 != null) {
        return false;
      }
    }
    else if (!userField6.equals(other.userField6)) {
      return false;
    }
    if (userField7 == null) {
      if (other.userField7 != null) {
        return false;
      }
    }
    else if (!userField7.equals(other.userField7)) {
      return false;
    }
    if (userField8 == null) {
      if (other.userField8 != null) {
        return false;
      }
    }
    else if (!userField8.equals(other.userField8)) {
      return false;
    }
    if (userField9 == null) {
      if (other.userField9 != null) {
        return false;
      }
    }
    else if (!userField9.equals(other.userField9)) {
      return false;
    }
    return true;
  }

  @Column(name = "CLIENT_HOSTNAME", length = 50)
  public String getClientHostname() {
    return clientHostname;
  }

  @Column(name = "CLIENT_IP", length = 50)
  public String getClientIp() {
    return clientIp;
  }

  @Column(name = "DURATION", precision = 22, scale = 0)
  public BigDecimal getDuration() {
    return duration;
  }

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "ID")
  @SearchableId
  public Long getId() {
    return id;
  }

  @Column(name = "REQUEST_DATE", length = 7)
  public Date getRequestDate() {
    return requestDate;
  }

  @Column(name = "SERVICE_HOST", length = 50)
  public String getServiceHost() {
    return serviceHost;
  }

  @Column(name = "SERVICE_NAME", length = 50)
  public String getServiceName() {
    return serviceName;
  }

  @Column(name = "TICKET", length = 100)
  public String getTicket() {
    return ticket;
  }

  @Column(name = "TRANSACTION_ID", length = 50)
  public String getTransactionId() {
    return transactionId;
  }

  @Column(name = "USER_FIELD_0", length = 50)
  public String getUserField0() {
    return userField0;
  }

  @Column(name = "USER_FIELD_1", length = 50)
  public String getUserField1() {
    return userField1;
  }

  @Column(name = "USER_FIELD_2", length = 50)
  public String getUserField2() {
    return userField2;
  }

  @Column(name = "USER_FIELD_3", length = 50)
  public String getUserField3() {
    return userField3;
  }

  @Column(name = "USER_FIELD_4", length = 50)
  public String getUserField4() {
    return userField4;
  }

  @Column(name = "USER_FIELD_5", length = 50)
  public String getUserField5() {
    return userField5;
  }

  @Column(name = "USER_FIELD_6", length = 50)
  public String getUserField6() {
    return userField6;
  }

  @Column(name = "USER_FIELD_7", length = 50)
  public String getUserField7() {
    return userField7;
  }

  @Column(name = "USER_FIELD_8", length = 50)
  public String getUserField8() {
    return userField8;
  }

  @Column(name = "USER_FIELD_9", length = 50)
  public String getUserField9() {
    return userField9;
  }

  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = (prime * result) + ((clientHostname == null) ? 0 : clientHostname.hashCode());
    result = (prime * result) + ((clientIp == null) ? 0 : clientIp.hashCode());
    result = (prime * result) + ((duration == null) ? 0 : duration.hashCode());
    result = (prime * result) + ((id == null) ? 0 : id.hashCode());
    result = (prime * result) + ((requestDate == null) ? 0 : requestDate.hashCode());
    result = (prime * result) + ((serviceHost == null) ? 0 : serviceHost.hashCode());
    result = (prime * result) + ((serviceName == null) ? 0 : serviceName.hashCode());
    result = (prime * result) + ((ticket == null) ? 0 : ticket.hashCode());
    result = (prime * result) + ((transactionId == null) ? 0 : transactionId.hashCode());
    result = (prime * result) + ((userField0 == null) ? 0 : userField0.hashCode());
    result = (prime * result) + ((userField1 == null) ? 0 : userField1.hashCode());
    result = (prime * result) + ((userField2 == null) ? 0 : userField2.hashCode());
    result = (prime * result) + ((userField3 == null) ? 0 : userField3.hashCode());
    result = (prime * result) + ((userField4 == null) ? 0 : userField4.hashCode());
    result = (prime * result) + ((userField5 == null) ? 0 : userField5.hashCode());
    result = (prime * result) + ((userField6 == null) ? 0 : userField6.hashCode());
    result = (prime * result) + ((userField7 == null) ? 0 : userField7.hashCode());
    result = (prime * result) + ((userField8 == null) ? 0 : userField8.hashCode());
    result = (prime * result) + ((userField9 == null) ? 0 : userField9.hashCode());
    return result;
  }

  public void setClientHostname(final String clientHostname) {
    this.clientHostname = clientHostname;
  }

  public void setClientIp(final String clientIp) {
    this.clientIp = clientIp;
  }

  public void setDuration(final BigDecimal duration) {
    this.duration = duration;
  }

  public void setId(final Long id) {
    this.id = id;
  }

  public void setRequestDate(final Date requestDate) {
    this.requestDate = requestDate;
  }

  public void setServiceHost(final String serviceHost) {
    this.serviceHost = serviceHost;
  }

  public void setServiceName(final String serviceName) {
    this.serviceName = serviceName;
  }

  public void setTicket(final String ticket) {
    this.ticket = ticket;
  }

  public void setTransactionId(final String transactionId) {
    this.transactionId = transactionId;
  }

  public void setUserField0(final String userField0) {
    this.userField0 = userField0;
  }

  public void setUserField1(final String userField1) {
    this.userField1 = userField1;
  }

  public void setUserField2(final String userField2) {
    this.userField2 = userField2;
  }

  public void setUserField3(final String userField3) {
    this.userField3 = userField3;
  }

  public void setUserField4(final String userField4) {
    this.userField4 = userField4;
  }

  public void setUserField5(final String userField5) {
    this.userField5 = userField5;
  }

  public void setUserField6(final String userField6) {
    this.userField6 = userField6;
  }

  public void setUserField7(final String userField7) {
    this.userField7 = userField7;
  }

  public void setUserField8(final String userField8) {
    this.userField8 = userField8;
  }

  public void setUserField9(final String userField9) {
    this.userField9 = userField9;
  }

  @Override
  public String toString() {
    return "MfServiceLog [id=" + id + ", transactionId=" + transactionId + ", serviceHost="
      + serviceHost + ", serviceName=" + serviceName + ", clientIp=" + clientIp
      + ", clientHostname=" + clientHostname + ", requestDate=" + requestDate + ", duration="
      + duration + ", userField0=" + userField0 + ", userField1=" + userField1 + ", userField2="
      + userField2 + ", userField3=" + userField3 + ", userField4=" + userField4 + ", userField5="
      + userField5 + ", userField6=" + userField6 + ", userField7=" + userField7 + ", userField8="
      + userField8 + ", userField9=" + userField9 + ", ticket=" + ticket + "]";
  }

}
